﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace CP2011_Assignment
{
    public partial class MenuInventoryUI : Form
    {

        InventorySystem invSys = new InventorySystem();
        public MenuInventoryUI()
        {
            InitializeComponent();
        }

        private void testToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }

        private void btnLogout_Click(object sender, EventArgs e)
        {
            
                this.Hide();
                this.Owner.Show();
                this.Dispose();
            
        }

        private void MenuInventory_FormClosing(object sender, FormClosingEventArgs e)
        {
            DialogResult result = MessageBox.Show("Are you sure you want to exit?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
            if (result == DialogResult.Yes)
            {
                this.Hide();
                this.Owner.Show();
                this.Dispose();
            }
            else
            {
                e.Cancel = true;
            }
        }

        private void btnCreateInventory_Click(object sender, EventArgs e)
        {
            this.Hide();
            CreateInvUI createInv = new CreateInvUI();
            createInv.Owner = this;
            createInv.Show();
        }

        private void btnCheckInventory_Click(object sender, EventArgs e)
        {
            this.Hide();
            CheckInvUI showInv = new CheckInvUI();
            showInv.Owner = this;
            showInv.Show();

        }

        private void btnDeleteInventory_Click(object sender, EventArgs e)
        {
            this.Hide();
            DeleteInventoryUI showDel = new DeleteInventoryUI();
            showDel.Owner = this;
            showDel.Show();
        }

        private void btnEditInventory_Click(object sender, EventArgs e)
        {
            this.Hide();
            EditInventoryUI showEdit = new EditInventoryUI();
            showEdit.Owner = this;
            showEdit.Show();
        }

        private void btnSupplyInventory_Click(object sender, EventArgs e)
        {
            this.Hide();
            SupplyInventoryUI showSupply = new SupplyInventoryUI();
            showSupply.Owner = this;
            showSupply.Show();
        }

        private void button1_Click(object sender, EventArgs e)
        {

        }
    } 
}
